
import request from '@/api/request.js'
//获取用户列表
export function getUserList(params) {
  return request({
    url: `/system/user`,
    method: 'get',
    params
  })
}

export function addUser(data) {
  return request({
    url: `/system/user/create`,
    method: 'post',
    data
  })
}

export function updateUser(data) {
  return request({
    url: `/system/user/update`,
    method: 'patch',
    data
  })
}

export function updateUserPassword(data) {
  return request({
    url: `/system/user/update/password`,
    method: 'patch',
    data
  })
}

export function removeUser(params) {
  return request({
    url: `/system/user/delete`,
    method: 'delete',
    params,
    paramsSerializer:{
      serialize:function(params){
        const keys = params.userPrimaryKeys.map(item=>`userPrimaryKeys=${item}`).join('&')
        return `${keys}`
      }
    }
  })
}

export function getStationList () {
  return request({
    url:'/system/position',
    method: 'get',
  })
} 

